package com.hanbang.mrcm.adapter;

import java.util.ArrayList;

import com.hanbang.mrcm.bean.HomeTypeData;
import com.hanbang.mrcm.home.HomeFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

public class HomeViewPageAdapter extends FragmentStatePagerAdapter {

	private ArrayList<HomeTypeData> datas = null;

	public HomeViewPageAdapter(FragmentManager fm, ArrayList<HomeTypeData> datas) {
		super(fm);
		this.datas = datas;
	}

	@Override
	public Fragment getItem(int arg0) {
		return new HomeFragment(datas.get(arg0));
	}

	@Override
	public int getCount() {
		return datas.size();
	}

	@Override
	public CharSequence getPageTitle(int position) {
		// TODO Auto-generated method stub
		return datas.get(position).getTitle();
	}

}
